package com.share.user.rest;

import com.alibaba.fastjson.JSONObject;
import com.share.user.config.Orange;
import feign.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * author:caifan
 * date:2019/9/20
 */
@RestController
@RequestMapping("/orange")
public class OrangeRest {
    @Autowired
    private Orange orange;

    @RequestMapping(value = "/property")
    public String getProperty(@Param("property")String property) {
        JSONObject o = (JSONObject)JSONObject.toJSON(orange);
        return o.get(property).toString();
    }
}
